<?php

declare(strict_types=1);

namespace App\Admin\Request\Admin;

use Hyperf\Validation\Request\FormRequest;

class SaveAddRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'account'=>'required|alpha_num|min:2|unique:admin|bail',
            'password'=>'required|string|min:6|bail',
            'name'=>'required|alpha_num|min:2|bail',
            'tel'=>'required|string|mobile|unique:admin|bail',
            'email'=>'required|email|bail',
            'sort'=>'required|integer|gt:0|bail',
        ];
    }
}
